package com.cmc.cloud.cmclink.doc.vo.blnovo;

import cn.hutool.core.collection.CollectionUtil;
import com.cmc.cloud.cmclink.doc.vo.blnocargovo.BlnoCargoUpdateReqVO;
import com.cmc.cloud.cmclink.doc.vo.blnocntrvo.BlnoCntrUpdateReqVO;
import com.cmc.cloud.cmclink.doc.vo.blnoscnvo.BlnoScnUpdateReqVO;
import com.cmc.cloud.cmclink.doc.vo.blnovslvoyvo.BlnoVslvoyUpdateReqVO;
import com.cmc.cloud.cmclink.doc.vo.docbkconfirmprintsetupvo.DocBkConfirmPrintSetupRespVO;
import com.cmc.cloud.cmclink.doc.vo.sovo.attachmentvo.AttachmentRespVO;
import com.cmc.cloud.cmclink.doc.vo.sovo.operatelog.OperateLogRespVO;
import com.cmc.cloud.cmclink.doc.vo.sovo.requirementsvo.RequirementsRespVO;
import com.cmc.cloud.cmclink.doc.vo.sovo.sobcrcheck.SoBcrCheckRespVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.List;
import java.util.Map;

/**
 * @author 周贤
 * @date 2025/8/18
 */
@Schema(description = "管理后台 - check dcr 结果")
@Data
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class SiDetailRespVO {
    @Schema(description = "订舱信息")
    private BlnoBaseInfoVO blnoBaseInfoVO;
    @Schema(description = "订舱航次路径")
    private List<BlnoVslvoyUpdateReqVO> siVslvoyList;
    @Schema(description = "订舱预配信息")
    private List<BlnoCntrUpdateReqVO> siForecastList;
    @Schema(description = "订舱货物信息")
    private List<BlnoCargoUpdateReqVO> siCargoList;
    @Schema(description = "订舱相关方信息")
    private List<BlnoScnUpdateReqVO> siScn;
    @Schema(description = "订舱特殊要求")
    private List<RequirementsRespVO> requireList;
    @Schema(description = "订舱附件")
    private List<AttachmentRespVO> attachmentList;
    @Schema(description = "DCR校验list")
    private List<SoBcrCheckRespVO> dcrCheckList;
    @Schema(description = "操作记录 list")
    private List<OperateLogRespVO> operateLogList;
    @Schema(description = "BCR校验总的结果")
    private Boolean checkBcr ;
    @Schema(description = "打印配置")
    private DocBkConfirmPrintSetupRespVO confirmPrintSetup;
    @Schema(description = "BookingTime配置")
    private Map<String, String> timeMap;

    public Boolean getCheckBcr() {
        return !CollectionUtil.isNotEmpty(dcrCheckList) || dcrCheckList.stream().filter(e -> e.getCheckStatus() == false).count() <= 0;
    }
}
